package com.qgs.waf.util;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.StringUtils;

public class StringUtil {

	public static List<String> getFixedLengthStr(String str, int num) {
		List<String> nums = new ArrayList<String>();
		for (int i = 1; i <= num; i++) {
			nums.add(str.substring(0, str.length() - (("i" + 1).length() - 1)) + i);
		}
		return nums;
	}

	public static List<String> string2List(String str, String rex) {
		if(StringUtils.isBlank(str))return null;
		String[] ss = str.split(rex);
		List<String> ls = new ArrayList<String>();
		for (String string : ss) {
			ls.add(string);
		}
		return ls;
	}

	public static void main(String[] args) {
		List list = StringUtil.getFixedLengthStr("C0010", 15);
		for (Object object : list) {
			System.out.print(object + " ");
		}
	}
}
